HPFSTIME Copyright 1993 by Ira J. Minor. All rights reserved. Table of Contents 1) Introduction 2) Command Syntax 3) Examples 4) Technical discussion 1) Introduction HPFSTIME is SHAREWARE written and supported by: Ira J. Minor 13024 S.W. 90 Court Miami, FL 33176 Phone (305) 251-1875 If you find this program useful, as I know you will, please send a registration fee of $10 along with your comments, criticism and suggestions. I am working on additional enhancements as well as other useful OS/2 utilities and tools. Thank you. Have you ever wondered what's going on when your hard disk light keeps flashing on and off. Well, wonder no more. HPFSTIME generates a list of files, for a given disk partition (drive), that meet the specified HPFS date/time stamp selection criteria. The HPFS file system maintains three sets of date and time stamps for each file on an HPFS formatted partition. They are as follows. a) the date and time the file was Created. b) the date and time the file was Last Accessed. c) the date and time the file was Last Written. For a detailed explanation of when these date/time stamps are updated, see the technical discussion section of this document. 2) Command Syntax: HPFSTIME drive{:}{\}{path} {selection option} Selection options: N files that have Never been accessed since creation. R files that have been Read but never written since creation. T Total files, irrespective of date and time stamps. Cdate files Created since "date". Cminutes files created in the last "minutes". W files Written since creation. Wdate files Written since "date". Wminutes files Written in the last "minutes". A files Accessed since creation. Adate files Accessed since "data". Aminutes files Accessed in the last "minutes". Notes: 1) If only a drive letter is entered, with no path, the search starts with the root directory and all subdirectories on the drive are searched. 2) If a drive letter and path are entered, the search starts at the given path and all subdirectories from that path are searched. 3) If no selection option is entered, the default selection option is Atodays-date and generates a list of all files Accessed today. 4) Dates MUST be EXACTLY six characters of the form YYMMDD. 5) Minutes is the number of minutes prior to now. Todays date is assumed. 6) All files, including hidden, system, read only and archived are searched. Output: If sorted output is desired, see examples below, the following columns should be used: Sort by Column Created 1 Last Access 16 Last Written 31 File Name 49 3) Examples: HPFSTIME D: list all files on the D drive that were accessed today (default). HPFSTIME D:\LOTUS list all files, on the D drive beginning with the Lotus directory, that were accessed today (default). HPFSTIME D: W930601 list all files, on the D drive, that were Written since June 1, 1993. HPFSTIME D: A90 list all files, on the D drive, that were Accessed in the last 90 minutes. Examples using various command line capabilities: HPFSTIME D: > PRN Redirect output to the default printer. HPFSTIME D: | MORE Pause output to the screen after each screen full. HPFSTIME D: | SORT /+16 Sort output by Last Access time stamp. HPFSTIME D: | SORT /+31 > PRN Sort output by Last Written time stamp and redirect output to the printer. 4) Technical Discussion: Have you ever wondered what OS/2 is doing when your hard disk light is flashing on and off for what seems to be unbelievably long periods of time? Well, wonder no more. OS/2, when accessing an HPFS formatted partition, time stamps every file when it is Created, Accessed or Written. The files include programs, DLLs, data, etc. By running the HPFSTIME program you can create a listing of a subset of the files that are of interest to you. Some of the ways I have used HPFSTIME are as follows: 1) Run immediately after booting OS/2 to see what files get loaded at boot time. If D: is the boot drive, run HPFSTIME D:. If you are interested in the order of program load, run HPFSTIME D: | SORT /+16. Remember that there are some files that get loaded prior to the HPFS file system being initialized and CONFIG.SYS loaded. These files will not show up. I have done additional experimentation to determine what these files are and the order that they get loaded. 2) Run immediately after booting OS2 to see what files get Written at boot time. HPFSTIME C: W10 will display all files on the C: drive that where Written in the lat 10 minutes. 3) Shut down the system, boot OS/2 from the install diskettes, run HPFSTIME to see what files get written at shutdown. Rather than boot from the install diskettes I have set up a four meg partition on my hard disk that boots a mini OS/2 system that will run a single text mode OS/2 program such as CHKDSK, FORMAT, HPFSTIME, or the C Set++ compiler. It requires about three megs of files which I copy from my big OS/2 system. By using HPFSTIME I was able to determine which files I needed to copy and in what order. By copying the files in the order that they will be loaded I minimize arm movement so the boot of the mini system goes very fast. Of course I use BootManager to give me the option of booting my big or mini OS/2 systems. 4) I do a lot of C Set++ compiles. By running HPFSTIME against my compiler and toolkit directories I was able to see exactly what files were accessed. I created a VDISK and a CMD file that copies the files from the hard disk to the VDISK. I also had to modify CONFIG.SYS so the compiler will look for what it needs in the VDISK first. My compiles go much faster now. I also discovered that it was using the link editor that comes with OS/2 rather than the one that comes with the compiler. In general, if you have multiple files with the same name, in different directories, you can see which one was actually accessed. Discussion of when HPFS date/time stamps are updated. The HPFS file system maintains three sets of date and time stamps for each file on an HPFS formatted partition. They are as follows: 1) The date and time the file was Created. 2) The date and time the file was Last Accessed. 3) The date and time the file was Last Written. The Created time stamp is the date and time the file was originally placed on your hard disk. When a disk partition is formatted there are no files on the partition, as files are placed on the disk the Created time stamp is set. It is never changed after its initial setting. The Last Accessed time stamp is the date and time the file was last read or written. The Last Written time stamp is the date and time the file was last updated. This is the time stamp displayed by the DIR command and is the same for both HPFS and FAT partitions. This time stamp can be older then the Created or Last Accessed time stamps. For example, the OS/2 system files have a Last Written time stamp of the last time they were updated by IBM prior to packaging the final release. Lets look at various examples of file accesses to get a better understanding of when the time stamps get updated. When you create and save a new file with an editor, all three time stamps will be set identically. When you subsequently modify the file, both the Last Written and Last Access time stamps will be updated. If you look at the file, with an editor or with the OS/2 TYPE command, only the Last Access time stamp will be updated. When you install a new program package the Create and Last Access time stamps will be set. The Last Written time stamp will reflect the date and time the programs were last updated by the program developer. When you run the programs the Last Access time stamp of the programs will be updated. Of course, if the programs read or update any data files, their time stamps will be updated accordingly. Lets next look at how various OS/2 commands affect the time stamps. COPY and XCOPY Several experiments were performed. Copying to new file names or existing file names made no difference how COPY or XCOPY handled time stamps. Neither COPY nor XCOPY ever modified the Last Written time stamp, since they weren't updating the files. The Last Access time stamps of both the source and target files were always updated by both COPY and XCOPY. The Create time of the target file was always updated by COPY but was never updated by XCOPY. RENAME Renaming a file does not change any of its time stamps. TYPE Type updates the Last Access time stamp only.